/**
 * 
 */
package com.shop.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shop.entities.Category;
import com.shop.repositories.CategoryRepository;

/**
 * @author Koni
 *
 */
@Service
@Transactional
public class CategoryService 
{
	@Autowired private CategoryRepository categoryRepository;
	
	public List<Category> findAllCategorys() {
		return categoryRepository.findAllCategories();
	}
	
	
	public Category findCategorysById(int id) {
		return categoryRepository.findCategoryById(id);
	}
	
	
	
	public void addCategory(Category c) {
		 categoryRepository.addCategory(c);
	}
	
	public void updateCategory(Category c) {
		 categoryRepository.updateCategory(c);
	}
	
	public void deleteCategory(Category c) {
		 categoryRepository.deleteCategory(c);
	}
	
}
